package com.yizhiliulianta.user.designPattern.filterPattern;

public enum ArticleFilterEnum {

    WORD_COUNT(0,"字数过滤器");

    private int code;

    private String desc;

    ArticleFilterEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ArticleFilterEnum getByCode(int codeVal){
        for (ArticleFilterEnum articleFilterEnum : ArticleFilterEnum.values()){
            if (articleFilterEnum.code == codeVal){
                return articleFilterEnum;
            }
        }
        return null;
    }
}
